package cn.interceptor;

import org.apache.struts2.convention.annotation.ParentPackage;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

/**
 * 
 * @项目名称:pigbaby
 * @类名称:LoginedCheckInterceptor
 * @类描述:
 * @创建人:陈凯
 * @创建时间:20150713 17：17 星期一
 * @修改人:
 * @修改时间:
 * 
 * @修改备注:
 * @version
 */
@ParentPackage(value="struts-default")
public class LoginedCheckInterceptor extends AbstractInterceptor {

	private static final long serialVersionUID = 1L;

	/**
	 * 
	 */
	@Override
	public String intercept(ActionInvocation arg0) throws Exception {
		if(arg0.getInvocationContext().getSession().containsKey("sessionuser")){
			return arg0.invoke();
		}
		else
		{
			return "login";
		}
	}
}
